package com.fira.api.controller;

import com.fira.api.domain.dto.LoginDTO;
import com.fira.common.core.domain.AjaxResult;
import com.fira.edu.domain.EduClassroom;
import com.fira.edu.service.IEduClassroomService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Api(value="教室信息接口",tags={"教室信息"})
@Controller
@RequestMapping("/api/classroom")
public class ClassroomController extends ApiController{
    @Autowired
    private IEduClassroomService eduClassroomService;

    @ApiOperation(value="查询教室列表",tags={"查询教室列表"},notes="")
    @PostMapping("/list")
    @ResponseBody
    public AjaxResult list(HttpServletRequest request){
        LoginDTO loginDTO = getLogin(request);
        String tenantId = loginDTO.getCurrentTenantId();
        EduClassroom classroom = new EduClassroom();
        classroom.setTenantId(tenantId);
        return AjaxResult.success("查询成功",eduClassroomService.selectEduClassroomList(classroom));
    }
}
